<%@ page contentType="text/html;charset=GB2312"%>
<%@ page import="java.sql.*"%>
<jsp:useBean id="db" scope="page" class="com.dj.conn.DataBean"></jsp:useBean>
<%
	   
	ResultSet rs = null;
	
	String id = request.getParameter("id");

	rs = db.executeQuery("select * from doc where ID=" + id);
	while (rs.next()) {
		try {
			java.io.InputStream in = rs.getBinaryStream("DocContent");
			java.io.OutputStream outStream = response.getOutputStream();
			byte[] buf = new byte[1024];
			int bytes = 0;
			while ((bytes = in.read(buf)) != -1)
			outStream.write(buf, 0, bytes);
			in.close();
			outStream.close();
			out.clear();
			out= pageContext.pushBody();
		} catch (Throwable e) {
			out.println(e.toString());
		}
	}
	rs.close();
	db.close();
%>